package com.lvshi0797.cms.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 以户口为单位简历的档案的基本信息
 * 
 * @author 沐叶
 *
 */
 @Entity
 @Table(name="f_baseinfo")
public class FBaseInfo implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	/**
	 * 户主名
	 */
	private String huzhuName;
	/**
	 * 家庭人口
	 */
	private int totalNum;
	/**
	 * 残疾人口
	 */
	private int disaNum;
	/**
	 * 贫困属性
	 */
	private String poorShuxing;
	/**
	 * 主要致贫原因
	 */
	private String poorCause;
	/**
	 * 主要收入来源
	 */
	private String mainIncome;
	/**
	 * 上年度人均纯收入 （元）
	 */
	private int lastPerIncome;
	/**
	 * 是否脱贫，0表示没有，1表示已脱贫。默认为0
	 */
	private int isOutPoor;
	/**
	 * 脱贫时间
	 */
	private String outPoorDate;
	/**
	 * 脱贫方式
	 */
	private String outPoorWay;
	/**
	 * 家庭地址：所属乡镇
	 */
	private String town;
	/**
	 * 家庭地址：所属村
	 */
	private String vallige;
	/**
	 * 家庭地址：所属组
	 */
	private String team;
	/**
	 * 联系电话
	 */
	private String contact;
	/**
	 * 填报时间
	 */
	private Date addTime;
	/**
	 * 残疾人享受帮扶项目或资金情况
	 */
	private Set<FProjectInfo> projects;
	/**
	 * 残疾人家庭成员基本情况
	 */
	private Set<FMember> members;
	/**
	 * 登记人
	 * 
	 */
	private FManager manager;
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	@Column(length=20)
	public String getHuzhuName() {
		return huzhuName;
	}
	 
	public int getTotalNum() {
		return totalNum;
	}
	public int getDisaNum() {
		return disaNum;
	}
	@Column(length=20)
	public String getPoorShuxing() {
		return poorShuxing;
	}
	@Column(length=150)
	public String getPoorCause() {
		return poorCause;
	}
	@Column(length=20)
	public String getMainIncome() {
		return mainIncome;
	}
	@Column(length=20)
	public int getLastPerIncome() {
		return lastPerIncome;
	}
	public int getIsOutPoor() {
		return isOutPoor;
	}
	@Column(length=20)
	public String getOutPoorDate() {
		return outPoorDate;
	}
	@Column(length=20)
	public String getOutPoorWay() {
		return outPoorWay;
	}
	@Column(length=20)
	public String getTown() {
		return town;
	}
	@Column(length=20)
	public String getVallige() {
		return vallige;
	}
	@Column(length=20)
	public String getTeam() {
		return team;
	}
	@Column(length=20)
	public String getContact() {
		return contact;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable=false)
	public Date getAddTime() {
		return addTime;
	}
	@OneToMany(fetch=FetchType.LAZY)
	@JoinColumn(name="baseid")
	public Set<FProjectInfo> getProjects() {
		return projects;
	}
	@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
	@JoinColumn(name="baseid")
	public Set<FMember> getMembers() {
		return members;
	}
	@ManyToOne(fetch=FetchType.EAGER,cascade=CascadeType.REFRESH)
	@JoinColumn(name="managerid",updatable=false)
	public FManager getManager() {
		return manager;
	}
	
	
	public void setId(int id) {
		this.id = id;
	}
	public void setHuzhuName(String huzhuName) {
		this.huzhuName = huzhuName;
	}
	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}
	public void setDisaNum(int disaNum) {
		this.disaNum = disaNum;
	}
	public void setPoorShuxing(String poorShuxing) {
		this.poorShuxing = poorShuxing;
	}
	public void setPoorCause(String poorCause) {
		this.poorCause = poorCause;
	}
	public void setMainIncome(String mainIncome) {
		this.mainIncome = mainIncome;
	}
	public void setLastPerIncome(int lastPerIncome) {
		this.lastPerIncome = lastPerIncome;
	}
	public void setIsOutPoor(int isOutPoor) {
		this.isOutPoor = isOutPoor;
	}
	public void setOutPoorDate(String outPoorDate) {
		this.outPoorDate = outPoorDate;
	}
	public void setOutPoorWay(String outPoorWay) {
		this.outPoorWay = outPoorWay;
	}
	public void setTown(String town) {
		this.town = town;
	}
	public void setVallige(String vallige) {
		this.vallige = vallige;
	}
	public void setTeam(String team) {
		this.team = team;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}
	public void setProjects(Set<FProjectInfo> projects) {
		this.projects = projects;
	}
	public void setMembers(Set<FMember> members) {
		this.members = members;
	}
	public void setManager(FManager manager) {
		this.manager = manager;
	}
	public FBaseInfo() {
		super();
	}
	public FBaseInfo(String huzhuName, int totalNum, int disaNum,
			String poorShuxing, String poorCause, String mainIncome) {
		super();
		this.huzhuName = huzhuName;
		this.totalNum = totalNum;
		this.disaNum = disaNum;
		this.poorShuxing = poorShuxing;
		this.poorCause = poorCause;
		this.mainIncome = mainIncome;
	}
	public FBaseInfo(int id, String huzhuName, int totalNum, int disaNum,
			String poorShuxing, String poorCause, String mainIncome,
			int lastPerIncome, int isOutPoor, String outPoorDate,
			String outPoorWay, String town, String vallige, String team,
			String contact) {
		super();
		this.id = id;
		this.huzhuName = huzhuName;
		this.totalNum = totalNum;
		this.disaNum = disaNum;
		this.poorShuxing = poorShuxing;
		this.poorCause = poorCause;
		this.mainIncome = mainIncome;
		this.lastPerIncome = lastPerIncome;
		this.isOutPoor = isOutPoor;
		this.outPoorDate = outPoorDate;
		this.outPoorWay = outPoorWay;
		this.town = town;
		this.vallige = vallige;
		this.team = team;
		this.contact = contact;
	}
	
	
	
	
	
	

}
